import { defineStore } from 'pinia'

export const useNaryadListRasp = defineStore('naryads_rasp', () => {
  const naryads = ref([])

  function setArray(newArray) {
    naryads.value = newArray
  }

  function getArray() {
    return naryads.value
  }

  function removeAnElement(index) {
    if (index === 0) {
        naryads.value.shift();
    } else {
        naryads.value.splice(index, 1);
    }
  }

  function getElement(index) {
    return naryads.value[index]
  }

  return { naryads, getArray, setArray, removeAnElement, getElement }

})